import java.util.Scanner;
public class Student {
    String name;
    String address;
    int classId;
    int StudentId;

    //自我介绍
    public void introduce(){
        System.out.println("我的名字是:"+name);
        System.out.println("班级是:"+classId);
        System.out.println("学号是:"+StudentId);
        System.out.println("来自:"+address);
    }
    //自己输入样例
    public void input(){
        //在变量前加一个this.就是给类里面的成员变量赋值，会改变类里面的值
        Scanner scanner =new Scanner(System.in);
        System.out.println("请输入名字:");
        this.name=scanner.nextLine();

        System.out.println("请输入班级:");
        this.classId=scanner.nextInt();
        scanner.nextLine();
        System.out.println("请输入学号:");
        this.StudentId=scanner.nextInt();
        scanner.nextLine();
        System.out.println("请输入来自哪里:");
        this.address=scanner.nextLine();

    }
    public static void main(String[]args){
        Student stu =new Student();
        stu.input();
        stu.introduce();
    }
    }

